#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <map>
#include <climits>

using namespace std;
typedef long long ll;

const int MOD=1000000007;
/**/

int main(){
    string s;
    cin >> s;
    int len=s.size(),i=0;
    ll base=0,ans=0;
    for(i=len-1;i>=0;i--){
        if('b'==s[i]){
            base++;
        }else{
            ans=(ans+base)%MOD;
            base=(2*base)%MOD;
        }
    }
    cout << ans<<endl;
    return 0;
}